package xiao.ke.sbdemo.controller;/**
 * @author XuXiaoK
 * @create 2019-12-17 12:25
 */

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import xiao.ke.sbdemo.model.Person;
import xiao.ke.sbdemo.repository.PersonRepository;

/**
 * @Author XiaoKe
 * @Date 2019/12/17 12:25
 * @Description TODO
 */
@RestController
@RequestMapping("/person")
public class PersonController {

    @Autowired
    private PersonRepository personRepository;

    @PostMapping("/save")
    public Person savePerson(@RequestBody Person person) {
        return personRepository.save(person);
    }
}
